package com.example.demo.reflect.dynamic;

import java.lang.reflect.Proxy;

/**
 * @author void
 * @date 2022/2/17 14:48
 * @desc
 */
public class DynamicProxyTest {

    public static void main(String[] args) {
        Target target = new TargetImpl();
        DynamicProxyHandler handler = new DynamicProxyHandler(target);
        Target proxySubject = (Target) Proxy.newProxyInstance(TargetImpl.class.getClassLoader(), TargetImpl.class.getInterfaces(), handler);

        System.out.println(proxySubject.execute());
    }
}
